﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"  Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <script type ="text/javascript" src ="../../Scripts/jquery-1.2.6.js"></script>  
    <script type ="text/javascript">
        function fetchData() {
         
            alert( "submit " + document.getElementById("testbox").value);
            $.getJSON("/Account/CheckLogin", { username: document.getElementById("username").value }, function(data) { document.getElementById("result").innerHTML = data.result; });
           
        }

 
      
    </script>
    <h2><%=Html.Encode(ViewData["lbHead"])%> </h2>
     
    <%--<%= Html.ValidationSummary() %>--%>
    
    <% using (Html.BeginForm()) { %>
    
        <div>
            <table>
                <tr>
                    <td></td>
                    <td><%=Html.Encode(ViewData["lbUsername"])%> </td>
                    <td>
                        <%= Html.TextBox("username") %>
                        <%= Html.ValidationMessage("username1") %>
                        <label id = "result"  ></label>
                        <input id="testbox"   />
                    </td>
                </tr>
                <tr>
                     <td></td>
                    <td><%=Html.Encode(ViewData["lbPassword"])%> </td>
                    <td>
                        <%= Html.Password("password") %>
                        <%= Html.ValidationMessage("password1") %>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><%= Html.CheckBox("rememberMe") %><%=Html.Encode(ViewData["lbRemindMe"])%></td>
                </tr> 
                <tr>
                    <td></td>
                    <td><input type="submit" name="Login" value ="<%=Html.Encode(ViewData["lbLogin"])%> "/> <%= Html.ActionLink( "注册", "Register") %></td>
                </tr>
            </table>
            <input type="button" value = "Click Me!" onclick = "fetchData()"/>
            
        </div>
    <% } %>
  
</asp:Content>
